﻿/*  
    Copyright (C) <2007-2013>  <Kay Diefenthal>

    ArgusTv.UI.MediaCenter is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    ArgusTv.UI.MediaCenter is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with ArgusTv.UI.MediaCenter.  If not, see <http://www.gnu.org/licenses/>.
*/

using System;
using System.Collections;
using ArgusTV.UI.MediaCenter.Models;
using Microsoft.MediaCenter.UI;

namespace ArgusTV.UI.MediaCenter.Views
{
    public class MultiChannelEpgView : ModelItem
    {
        private Command _leftCommand;
        private Command _rightCommand;
        private Command _upCommand;
        private Command _downCommand;
        private IList _filterCommands;
        private IList _filteredContent;
        private FilterCommand _currentFilterCommand;
        private ListingItemOffer _listingItemOffer;

        public IList FilterCommands
        {
            get {return _filterCommands; }
            set { if (_filterCommands != value) { _filterCommands = value; FirePropertyChanged("FilterCommands"); } }
        }

        public IList FilteredContent
        {
            get { return _filteredContent; }
            set { if (_filteredContent != value) { _filteredContent = value; FirePropertyChanged("FilteredContent"); } }
        }

        public Int32 FilterCommandIndex
        {
            get 
            { 
                if(_filterCommands!=null)
                    return _filterCommands.IndexOf(CurrentFilterCommand);
                return -1;
            }
        }

        public FilterCommand CurrentFilterCommand
        {
            get { return _currentFilterCommand; }
            set { if (_currentFilterCommand != value) { _currentFilterCommand = value; OnFilterCommandChanged(_currentFilterCommand, EventArgs.Empty); FirePropertyChanged("CurrentFilterCommand"); } }
        }

        public ListingItemOffer ListingItemOffer
        {
            get { return _listingItemOffer; }
            set { if (_listingItemOffer != value) { _listingItemOffer = value; FirePropertyChanged("ListingItemOffer"); } }
        }

        public void SetFilterCommand(Command command)
        {
            var filtercommand = command as FilterCommand;
            _currentFilterCommand = filtercommand;
        }

        public event EventHandler FilterCommandChanged;

        protected virtual void OnFilterCommandChanged(object sender, EventArgs args)
        {
            if (FilterCommandChanged != null)
                FilterCommandChanged(sender, args);
        }



    }
}